package com.link.base.base.agreement.service;

import com.link.base.base.agreement.model.Agreement;
import com.link.core.basic.service.BasicService;
import com.link.core.basic.service.BasicServiceException;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
 * Copyright  hande Company. All Rights Reserved.
 *
 * @author  unknwon
 * @date:   2018/11/8 10:46
 * @version 1.0
 */

public interface AgreementService extends BasicService<Agreement> {

    /**
     * 提交合同审批表
     * @param entity
     * @throws Exception
     */
    public void submit(Agreement entity) throws Exception;

    /**
     * 根据合同编码查找合同审批记录
     * @param entity
     * @return
     * @throws Exception
     */
    public List<Agreement> queryByContractCode(Agreement entity) throws Exception;

    /**
     * <p>检查该记录是否已存在，是则返回对象，否则返回null</p>
     * @author yrf
     * @param model
     * @return
     * @throws Exception
     */
    public Agreement check(Agreement model) throws Exception;


    /**
     * 校验客户
     *
     * @param acctId 客户ID
     */
    public void checkAcct(Long acctId) throws Exception;

    /**
     * 更新头行信息-interface用到
     * @param model
     * @return
     * @throws Exception
     */
    public Agreement upsertHeadAndItem(Agreement model)throws Exception;

    /**
     * 批量更新头行信息-interface用到
     * @param list
     * @return
     * @throws Exception
     */
    @Transactional(rollbackFor = BasicServiceException.class)
    public void batchUpsertHeadAndItem(List<Agreement> list)throws Exception;

}
